package cn.edu.zafu.bigdata.psy;

class Animal {
    protected String name;

    public Animal(String name) {
        this.name = name;
    }
    public String makeSound() {
        return "Animal sound";
    }
}
class Dog extends Animal {
    public Dog(String name) {
        super(name);
    }
    public String makeSound() {
        return "Woof!";
    }
}

class Cat extends Animal {
    public Cat(String name) {
        super(name);
    }

    public String makeSound() {
        return "Meow!";
    }
}

public class Question1 {
    public static void main(String[] args) {
        Dog dog = new Dog("dog");
        Cat cat = new Cat("cat");

        System.out.println(dog.name + ": " + dog.makeSound());
        System.out.println(cat.name + ": " + cat.makeSound());
    }
}
